package tests;

import common.Utils;
import org.openqa.selenium.By;

public class ListPage extends Utils {

    public static String url = "http://127.0.0.1:58080/index.html";
    public ListPage() {
        super(url);
    }

    public void Text() throws InterruptedException {
        driver.findElement(By.cssSelector("#index_nav_avatar")).click();
        driver.findElement(By.cssSelector("#index_user_logout > span")).click();
        Thread.sleep(2000);
        driver.quit();
    }


    /*
     * 通过查找页面元素检查页面是否登录成功
     * */
//    public void ListPageByLogin() throws InterruptedException {
//        //检测是否有“搜索框”
//        driver.findElement(By.cssSelector("body > div.page > header.navbar.navbar-expand-md.navbar-light.d-print-none > div > div > div.nav-item.d-none.d-md-flex.me-3 > div > form > div > input"));
//        //检查是否有“首页”按钮
//        driver.findElement(By.cssSelector("#nav_board_index > a > span.nav-link-title"));
//        //检查是否有“发布帖子”
//        driver.findElement(By.cssSelector("#bit-forum-content > div.page-header.d-print-none > div > div > div.col-auto.ms-auto.d-print-none > div > a.btn.btn-primary.d-none.d-sm-inline-block.article_post"));
//
//        Thread.sleep(2000);
//        driver.quit();
//    }

}
